<% layout('/layouts/default.html', {title: '过程审核-任务部署审核-子任务', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<#form:form id="searchForm" model="${dcSupTaskAudit}" action="${ctx}/audit/dcSupTaskAudit/listDataChild?auditStatus=1" method="post" class="form-inline"
			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div style="float: right">
				<#form:hidden path="taskYear"/>
				<#form:hidden path="messageNumber"/>
				<#form:hidden path="taskTitle"/>
				<#form:hidden path="taskTypeCode"/>
				<div class="form-group">
					<label class="control-label">${text('任务内容')}：</label>
					<div class="control-inline width-160">
						<#form:input path="taskContent" maxlength="200" class="form-control width-160" placeholder="请输入任务内容"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</div>
			</#form:form>
		</div>
		<div class="box-body">
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
	//重置
	function cz(){
		searchForm.reset();
		$('#dataGrid').dataGrid('reloadGrid');
	}

	// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	sortableColumn: false, // 列表不允许排序
	columnModel: [
		{header:'${text("主键")}', name:'id', index:'a.id', width:150, align:"left", frozen:true, hidden:true},
		{header:'${text("任务标题")}', name:'taskTitle', index:'a.task_title', width:150, align:"left"},
		{header:'${text("任务内容")}', name:'taskContent', index:'a.task_content', width:150, align:"left", formatter: function(val, obj, row, act){
				return '<a href="${ctx}/taskdeploy/dcSupTaskInfo/detailForm?id='+row.taskId+'" class="btnList" data-title="${text("督办任务信息")}">'+(val||'暂无内容')+'</a>';
			}},
		{header:'${text("完成时限")}', name:'taskEndTime', index:'a.task_end_time', width:120, align:"center",
			formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i'}},
		{header:'${text("牵头责任单位")}', name:'taskLeaderOrgName', index:'a.task_leader_org_name', width:100, align:"left"},
		{header:'${text("督办人")}', name:'taskSupUserName', index:'a.task_sup_user_name', width:100, align:"center"},
		{header:'${text("督办科室")}', name:'taskSupOrgName', index:'a.task_sup_orgname', width:100, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('audit:dcSupTaskAudit:edit')){ %>
				actions.push('<a href="${ctx}/audit/dcSupTaskAudit/form?id='+row.id+'" class="btn btn-primary btn-xs btnList" title="${text("审核")}">审核</a>&nbsp;');
			<% } %>
				if(row.normalFlag=='2'){
					actions.push('<a href="${ctx}/taskdeploy/dcSupTaskInfo/delete?id='+row.targetId+'" class="btn btn-danger btn-xs btnList" title="${text("删除任务")}" data-confirm="${text("确认要彻底删除该任务吗？")}">删除</a>&nbsp;');
			}
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>